<template>
  <div class="icons">
    <!-- <div class="icon-box" v-for="item of icons" :key="item.id">
      <img class="icon-img" v-lazy="item.imgUrl" :alt="item.name">
      <p class="icon-name">{{item.name}}</p>
    </div> -->
    <div class="icon-box" v-for="item of icons" :key="item.id">
      <router-link tag="div" :to="item.link">
        <img class="icon-img" v-lazy="item.imgUrl" :alt="item.name">
        <p class="icon-name">{{item.name}}</p>
      </router-link>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HomeIconsTwo',
  props: {
    icons: Array
  }
}
</script>

<style lang="stylus" scoped>
.icon-box
  width: 20%
  float: left
  overflow: hidden
  height: auto
  .icon-img
    width: 0.54rem
    height: 0.54rem
    display: block
    margin: 0.32rem auto 0
  .icon-name
    font-size: 0.26rem
    color: #333333
    text-overflow: clip
    white-space: nowrap
    overflow: hidden
    line-height: 0.8rem
    height: 0.8rem
    text-align: center
</style>
